import request from '@/utils/request'

// 登录
export function login(userName, password) {
  const data = {
    userName,
    password
  }
  return request({
    url: '/small_auth/auth/login',
    headers: {
      isToken: false,
      repeatSubmit: false
    },
    method: 'post',
    data: data
  })
}

// 注册
export function register(data) {
  return request({
    url: '/auth/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 退出
export function logout() {
  return request({
    url: '/auth/logout',
    method: 'delete'
  })
}